(defun make-comparision-expr (field value)
  `(equal (getf cd ,field ) ,value)

(defun make-comparision-list (field)
  (loop while field
     collecting (make-comparision-expr (pop field) (pop field))))

(defun sellect (sellector-in)
  (remove-if-not sellector-in *db*)

(defun update (sellector-in &key title artist rating (ripped nil ripped-p))
  (setf *db* 
	(mapcar 
	 #'(lambda (row) 
	     (when (funcall sellector-in row)
	       (if title (setf (getf row :title) title))
	       (if artist (setf (getf row :artist) artist))
	       (if rating (setf (getf row :rating) rating))
	       (if ripped-p (setf (getf row :ripped) ripped)))
	       row) *db*)))

(defun delete-row
 (sellector-in)
  (setf *db*
	(remove-if sellector-in *db*)))


(defmacro where (&rest clauses)
  `#'(lambda (cd) (and ,@(make-comparision-list clauses))))

  